1. Field of the Invention
The invention generally relates to displaying surfaces of images. More specifically, the invention relates to color clipping of extremely bright images, taking into account surface color and texture, while giving the appearance of a very bright surface.
2. Description of the Related Art
In rendered images such as those created using radiosity, particle traced, or ray traced images, multiple or bright lights can cause a pixel of an image to exceed the maximum allowable value. Conventionally, a very bright pixel, which exceeds the maximum value, will simply be clipped to the maximum value. This usually causes the pixel to be displayed as white, regardless of the actual color of the surface. Therefore, a surface of an image in a very bright lighting environment as displayed is substantially or entirely white.
For years, users have complained that the conventional, existing approach of simply clipping the pixel to the maximum value has caused images to appear washed out. For example, radiosity images with sunlight might appear to be washed out.
FIG. 1 is an illustration of the prior art approach to color clipping. Here, virtually the entire surface is extremely bright, and the value of each pixel in the surface exceeds the maximum allowable value. Using the conventional approach, each pixel is simply clipped to the maximum value. Thus, although the actual values of the pixels are different, after conventional color clipping, virtually all of the pixels all have the same bright value. Note that the surface image appears so washed-out as to be substantially white.
FIG. 3 also illustrates the conventional prior art approach. It is the same image as FIG. 1, scaled by 1/2 to illustrate more detail. In this illustration, although the surface is very bright, many of the pixel values are just below the maximum value. After conventional color clipping, pixels in large sections of the image all have the same bright value, so that there is no detail in those areas. Moreover, even in the areas that have some pixels below the maximum value, details are lost. Again, even though only certain portions of the image exceed maximum values, the image as a whole appears to be washed-out and unclear.
Thus, there remains a need for color clipping that does not result in a washed-out image. Further, there is a need for color clipping that takes into account color and other features of the surface, while still giving the appearance of an extremely bright image.
According to the present invention, color clipping takes into account the actual color of the surface, including texture mapping, while still giving the appearance of a very bright surface. Further, the invention provides color clipping that does not result in a washed-out image. According to the invention, there is provided a method and system for color clipping an image to be displayed, the image having at least one value to be color clipped.
The method and system includes determining a maximum value of at least one color component for at least one value. Also included is determining a ratio of the maximum value to a maximum allowable value. A scaling factor is determined based on the determined ratio. The value to be color clipped is set to a value including the scaling factor.
In one embodiment, the scaling factor is non-linear. In another embodiment, the scaling factor is logarithmic.
In an embodiment, the value is color components of at least one pixel.
In one variation, the image to be displayed includes at least one surface, and there are provided a plurality of values to be color clipped.
In another embodiment, determining the maximum value includes obtaining the value of each color component, and determining the maximum value of the obtained values. In yet another embodiment, determining the ratio further includes obtaining the maximum allowable value. In another embodiment, determining the scaling factor further includes computing the scaling factor as the Log10 of the ratio; or includes adding the value 1 to the scaling factor, and multiplying by a variable scale factor.
In another embodiment, setting the value to be color clipped includes determining the value including the scaling factor to be:
MaxPixelxe2x88x92MaxPixel*(xxe2x88x92Color/MaxComponent)scaling factor
In one variation, (xxe2x88x92Color/MaxComponent) is positive. In another variation, the scaling factor is non-linear.
The system and method further include displaying the image to be displayed, the image including the color-clipped value.
These and other objects, features and advantages of the present invention are readily apparent from the following drawings and detailed description.